<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>16.对象添加Symbol类型的属性</title>
</head>
<body>
    <script>
        // 向对象中添加方法 up down
        let game = {

        }

        //声明一个对象
        let methods = {
            up:Symbol(),
            down:Symbol()
        }

        game[methods.up] = ()=>{
            console.log('我是向上的方法');
        }
        game[methods.down] = ()=>{
            console.log('我是向下的方法');
        }

        console.log(game)

        let youxi = {
            name : '狼人杀',
            [Symbol('Say')]:()=>{
                console.log('发言');
            },
            [Symbol('Boom')]:()=>{
                console.log('自爆');
            }

        }
        console.log(youxi)
    </script>
</body>
</html>